<%- include('../../common/header.html',{css:'no-common'}) %>

<link rel="stylesheet" href="../../libs/jcrop/css/jquery.Jcrop.css" type="text/css"/>

    <style type="text/css">
        .content {
            padding-top: 10px;
            padding-bottom: 0px;
        }

        /* Apply these styles only when #preview-pane has
           been placed within the Jcrop widget */
        .jcrop-holder #preview-pane {
            display: block;
            position: absolute;
            z-index: 2000;
            top: 10px;
            right: -280px;
            padding: 6px;
            border: 1px #eee solid;
            background-color: white;

            -webkit-border-radius: 2px;
            -moz-border-radius: 2px;
            border-radius: 2px;

            -webkit-box-shadow: 1px 1px 5px 2px rgba(0, 0, 0, 0.2);
            -moz-box-shadow: 1px 1px 5px 2px rgba(0, 0, 0, 0.2);
            box-shadow: 1px 1px 5px 2px rgba(0, 0, 0, 0.2);
        }

        /* The Javascript code will set the aspect ratio of the crop
           area based on the size of the thumbnail preview,
           specified here */
        #preview-pane .preview-container {
            width: 107px;
            height: 142px;
            overflow: hidden;
        }

        .img-upload {
            width: 450px;
            height: 450px;
            overflow: hidden;
            border: 1px solid #ddd;
            text-align: center;
        }

        .img-upload img {

            max-width: 100%;
            max-height: 100%;
            display: block;;
        }

        .user-thumb-update .upload-tips {
            display: none;
        }

        .user-thumb-update:hover .upload-tips {
            display: block;
        }

    </style>
    <title>用户管理-后台管理系统</title>
</head>
<body class="sub-body">
<%- include('../../common/top-nav.html') %>
<%- include('../../common/page-title.html',{navs:[
{label:'首页',url:'../../main.html'},
{label:'CRM管理',url:'javascript:void(0)'},
{label:'销售交易额统计',url:'./sale-cash.html'},
{label:'销售员交易额统计',url:'javascript:void(0)'},
]}) %>
<div class="content" style="padding-top: 0">
    <div class="panel panel-default" style="overflow: auto;">
        <div class="panel-body" style="min-height: 500px;">
            <h3 style="margin: 0"><span class="goodsName"></span></h3>
            <div id="container" style="min-width:400px;height:400px"></div>
        </div>
    </div>
</div>
</body>
<%- include('../../common/script-moment.html') %>
<%- include('../../common/script-common.html') %>
<%- include('../../common/script-highcharts.html') %>


<script type="text/javascript">
    var form = null, path = '', img_jcrop = null, searchObj = parseSearch();

    $(function () {
        var obj = parseSearch();
        var query = {};

        $.get('/order/queryMyOrder?saleId=' + obj.id, function (data) {
            var list = data.list;
            if (list) {
                $('.goodsName').html("销售员："+decodeURI(obj.name)+'');
                var categorys = [], price = [];
                list.map(function (item) {
                    categorys.push(moment(item.createAt).format('YYYY-MM-DD'));
                    price.push(item.actualTotal);
                });

                var chart = new Highcharts.Chart('container', {
                    credits: {
                        enabled: false //不显示LOGO
                    },
                    title: {
                        text: '',
                        x: -20
                    },
                    subtitle: {
                        text: '',
                        x: -20
                    },
                    xAxis: {
                        categories: categorys
                    },
                    yAxis: {
                        title: {
                            text: '交易金额(元)'
                        },
                        lineWidth: 1,
                        labels: {
                            align: 'left',
                            x: 3,
                            y: -3
                        },
                        plotLines: [{
                            value: 0,
                            width: 1,
                            color: '#808080'
                        }]
                    },
                    tooltip: {
                        valueSuffix: '元'
                    },
                    legend: {
                        align: 'right',
                        verticalAlign: 'top',
                        y: 20,
                        floating: true,
                        borderWidth: 0
                    },
                    series: [{
                        name: '订单金额',
                        data: price
                    }]
                });
            }
        });


    });
</script>

</html>